<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta文档*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>选择项目</title>

    <!-- Bootstrap -->
    <link href="/common/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="/common/bootstrap/js/html5shiv.min.js"></script>
    <script src="/common/bootstrap/js/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-offset-4 col-md-4">
            <div class="panel panel-default" style="margin-top: 20%">
                <div class="panel-heading">
                    <span onclick="location.href='${mp}'" style="cursor: pointer;"
                          class="glyphicon glyphicon-chevron-left text-primary" aria-hidden="true"></span>
                    <h3 class="panel-title" style="display: inline-block;">选择项目</h3>
                </div>
                <div class="panel-body">
                    <form action="#" id="selectProject">
                        <div class="row">
                            <div class="col-md-10">
                                <select name="projectId" id="projectId" class="form-control">
                                    <#list list as d>
                                    <option value="${d.id}">${d.name}</option>
                                    </#list>
                                </select>
                            </div>
                            <div class="col-md-2">
                                <button type="button" class="btn btn-success" onclick="saveId()">确定</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="/common/bootstrap/js/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="/common/bootstrap/js/bootstrap.min.js"></script>
<script>
    function aaa() {
        $.ajax({
            url: "${dn}/b/api/ajax/add",
            type: "post",
            data: {},
            dataType: "json",
            success: function (res) {
                console.log(res)
            },
            error: function () {

            }
        });
    }
    function saveId() {
        $.ajax({
            url: "${dn}/v2/u/set/project",
            type: "post",
            data: {
                "pId": $("#projectId").val()
            },
            dataType: "json",
            success: function (re) {
                if (re.status) {
                    location.href = "${dn}${mp}"
                }
            },
            error: function () {

            }
        });
    }
</script>
</body>
</html>